import Vue from 'vue'
import VueRouter from 'vue-router'
import userLoginVue from '@/views/userLogin.vue'
import superUser from '@/views/superUser.vue'
import index from '@/views/InDex1.vue'
import front from '@/views/front/From.vue'
userLoginVue
Vue.use(VueRouter)
Vue.use(superUser)
Vue.use(index)
Vue.use(front)

const routes = [
  {
    path: '/front',
    name: 'home',
    component: () => import('../views/userLogin.vue')
  },
  
  {
   path:'/Login',
   name:'superUser',
   component: () => import('../views/superUser.vue')
  },{
    path:'/index',
    name:'index',
    component: () => import('../views/InDex1.vue')
   },
   {
    path:'/',
    name:'front',
    redirect: "/topview",
    component: () => import('../views/front/From.vue'),
     meta: {title:'广软商城', path: '广软商城', requireAuth: false},
     children: [
      {path: 'topview', name: 'topview', meta: {title:'广软商城'}, component: () => import('../views/front/TopView.vue'),},
      {path: 'cart', name: 'cart', meta: {title:'我的购物车',requireLogin: true}, component: () => import('../views/front/good/Cart.vue'),},
      {path: 'goodList', name: 'goodList', meta: {title:'商品界面'}, component: () => import('../views/front/good/GoodList.vue'),},
      {path: 'goodView/:goodId', name: 'goodview', meta: {title:'商品详情'}, component: () => import('../views/front/good/GoodView.vue'),},
      {path: 'schoolMarket', name: 'schoolMarket', meta: {title:'校园集市'}, component: () => import('../views/front/market/SchoolMarket.vue'),},
      {path: 'orderList', name: 'orderList', meta: {title:'我的订单',requireLogin: true}, component: () => import('../views/front/order/OrderList.vue'),},
      {path: 'pay', name: 'pay', meta: {title:'付款',requireLogin: true}, component: () => import('../views/front/order/Pay.vue'),},
    ]
   },
   {
    path: '/manage',
    name: 'manage',
    component: () => import('../views/manage/ManagePage.vue'),
    redirect: "/manage/home",
    meta: {title:'后台', path: '后台',requireAuth: true},
    children: [   
       {path: 'home', name: 'home', meta: {title:'主页', path: '主页',requireAuth: true}, component: () => import('../views/manage/Home.vue'),},
       {path: 'user', name: 'user', meta: {title:'用户管理',path: '系统管理/用户管理',requireAuth: true}, component: () => import('../views/manage/User.vue'),},
       {path: 'person', name: 'person', meta: {title:'个人信息',path: '个人信息',requireAuth: true}, component: () => import('../views/Person.vue'),},
       {path: 'file', name: 'file', meta: {title:'文件管理',path: '文件/文件管理',requireAuth: true}, component: () => import('../views/manage/file/File.vue'),},
       {path: 'category', name: 'category', meta: {title:'商品分类管理',path: '商品/商品分类管理',requireAuth: true}, component: () => import('../views/manage/good/Category.vue'),},
       {path: 'good', name: 'good', meta: {title:'商品管理',path: '商品/商品管理',requireAuth: true}, component: () => import('../views/manage/good/Goods.vue'),},
       {path: 'goodInfo', name: 'goodInfo', meta: {title:'商品管理',path: '商品/商品管理/商品信息',requireAuth: true}, component: () => import('../views/manage/good/GoodInfo.vue'),},
       {path: 'order', name: 'order', meta: {title:'订单管理',path: '商品/订单管理',requireAuth: true}, component: () => import('../views/manage/Order.vue'),},
 
    ]
  },
  
 
 
]

const router = new VueRouter({
  routes
})

export default router
